package com.px.common.core;

import lombok.Getter;
import lombok.NonNull;

@Getter
public class RespException extends RuntimeException{
    private int status;
    private String message;
    private Object data;

    public RespException(int status, @NonNull String message, Object data){
        super(message);
        this.status = status;
        this.message = message;
        this.data = data;
    }

    public RespException(RespCode respCode, Object data){
        super(respCode.getMsg());
        this.status = respCode.getStatus();
        this.message = respCode.getMsg();
        this.data = data;
    }
}